package com.ali.common;

import java.util.Objects;

public class ObjectUtil {
    /**
     * 判断是否为Null
     */
    public static boolean isNull(Object object) {
        return Objects.isNull(object);
    }

    /**
     * 判断是否不为Null
     */
    public static boolean nonNull(Object object) {
        return Objects.nonNull(object);
    }

    /**
     * 判断是否为Null，为Null就报错，不为Null就返回
     */
    public static Object requireNonNull(Object object, String message) {
        return Objects.requireNonNull(object, message);
    }

    /**
     * 比较内存地址
     */
    public static boolean equals(Object object1, Object object2) {
        return Objects.equals(object1, object2);
    }

    /**
     * 比较内容
     */
    public static boolean deepEquals(Object object1, Object object2) {
        return Objects.deepEquals(object1, object2);
    }
}